local pro2em = require("pro2em")
local ex2lua = require("ex2lua")

for _, cmd in ipairs({ ... }) do
    if cmd == "pb" then
        local obj = pro2em:new({
            proDir = "./proto/",
            emmDir = "./design/emmy/",
            luaFix = ".lua",
            proFix = ".proto",
        })
        obj:launch()
    elseif cmd == "sex2lua" then
        local obj = ex2lua.new({
            isserver      = true,
            readDir       = "./design/Excel/",
            writeDir      = "./design/server/luacfg/",
            md5fpath      = "./design/server/cache/md5Cache.lua",
            structfpath   = "./design/server/cache/lua_struct.lua",
            metablefpath  = "./design/server/cache/lua_metable.lua",
            dirExcelfpath = "./design/server/cache/dir_excel.lua",
            rffix         = ".xlsx",
            wffix         = ".lua",
            fsort         = {
                ["./design/Excel/struct.xlsx"] = -1, --需要最先解析这个
            },
            fstruct       = "lua_struct",
            fxstruct      = "struct",
            fglobal       = { ---全局配置|竖着的配置
                cfg_global = true,
            },
        })
        obj:launch()
    elseif cmd == "cex2lua" then
        local obj = ex2lua.new({
            isserver      = false,
            readDir       = "./design/Excel/",
            writeDir      = "./design/client/luacfg/",
            md5fpath      = "./design/client/cache/md5Cache.lua",
            structfpath   = "./design/client/cache/lua_struct.lua",
            metablefpath  = "./design/client/cache/lua_metable.lua",
            dirExcelfpath = "./design/client/cache/dir_excel.lua",
            rffix         = ".xlsx",
            wffix         = ".lua",
            fsort         = {
                ["./design/Excel/struct.xlsx"] = -1, --需要最先解析这个
            },
            fstruct       = "lua_struct",
            fxstruct      = "struct",
            fglobal       = { ---全局配置|竖着的配置
                cfg_global = true,
            },
        })
        obj:launch()
    end
end
